/*
 * @Author: szx
 * @Date: 2022-07-04 13:47:40
 * @LastEditTime: 2022-07-04 13:50:43
 * @Description:
 * @FilePath: \leetcode\1200-1299\1200\1200.js
 */
/**
 * @param {number[]} arr
 * @return {number[][]}
 */
var minimumAbsDifference = function (arr) {
    arr.sort((a, b) => a - b);
    let min = Infinity;
    for (let i = 0; i < arr.length - 1; i++) {
        const tmp = arr[i + 1] - arr[i];
        if (tmp < min) min = tmp;
    }
    const res = [];
    for (let i = 0; i < arr.length; i++) {
        if (arr[i + 1] - arr[i] === min) res.push([arr[i], arr[i + 1]]);
    }
    return res;
};
